<!DOCTYPE html>
<html>
<head>
<title>债权管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">
<script type="text/javascript">
    //$.fn.iframeWidthResize(640);//页面最小宽度设置
    var dataGrid;
    var winWidth =  900;
    var winHeight = 500;
    var verifyTitle = "转让记录";
    var verifyUrl =  "/modules/loan/bond/bondTenderRecordPage.html";
    var verifyWinParmeters = "'{0}','"+verifyTitle+"',900,500,'"+verifyUrl+"'";
        
    $(function() {
        dataGrid = $('#bondManagerList').datagrid({
            url : 'bondList.html',
            fit : true,
            border : false,
            pagination : true,
            idField : 'name',
            pageSize : pageSize,
            pageNums :1,
            pageList : pageList,
            sortName : 'name',
            sortOrder : 'asc',
            checkOnSelect : false,
            selectOnCheck : false,
            nowrap : false,
		singleSelect:true,
            frozenColumns:[[ 
                { field: 'name', title: '编号',  fixed:true,sortable:false },              
                { field: 'borrowName', title: '标名', width: 200, sortable:false }
            ]],
            columns : [ [
            { field: 'borrowType', title: '标类型', width: 100, sortable:false , 
                formatter: function(value,row,index){
                  return borrowType(value);  
                  }  
            },
              { field: 'bondMoney', title: '债权总价', width: 120, sortable:false,formatter: function(value,row,index){
            	  return value+"元";
              }},
              { field: 'apr', title: '年化收益', width: 170, sortable:false,formatter: function(value,row,index){
            	  return value+"%";
              }},
              { field: 'borrowStyle', title: '还款方式', width: 170, sortable:false , 
					formatter: function(value,row,index){
					if (row.borrowStyle == 1){
						return '按月分期还款';
					} else if (row.borrowStyle == 2){
						return '一次性还款';
					} else if (row.borrowStyle == 3){
						return '每月还息到期还本';
					}  else {
						return value;
					}
				}  
            },
            /* { field: 'bondMoney', title: '剩余债权', width: 120, sortable:false,formatter: function(value,row,index){
          	  return value+"元";
            }}, */
              { field: 'remainDays', title: '剩余期限', width: 170, sortable:false,formatter: function(value,row,index){
            	  return value+"天";
              }},
              { field: 'bondApr', title: '折让率', width: 80, sortable:false,formatter: function(value,row,index){
            	  return value+"%";
              }},
              { field: 'addTime', title: '添加时间', width: 150,fixed:true, sortable:false,formatter: function(value,row,index){
            	  return getLocalTime(value,4);
  				  }  
              }, 
              { field : 'action',
                title : '操作',
                width :75,
                fixed:true,
                align:'center',
                formatter : function(value, row, index) {
                	var str = '';
                  str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.closeFun('+row.id+',verifyTitle,winWidth,winHeight,verifyUrl);" title="'+verifyTitle+'">记录</a>';
                  return str;
                }
            } ] ]
        });
    });
</script>
</head>
<body style="padding:0 20px;" >
    <div class="easyui-layout" data-options="fit : true,border : false">
        <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder="标名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
                        <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
		        	<li><span>标的类型</span><select name="borrowType" class="type"><option value="0">全部</option><#list borrowConfigList as item><option value="${item.id}">${item.name}</option></#list></select></li>
		       		<li><span>标名</span><input type="text" name="borrowName" autocomplete="off"/></li>
		       		<li><span>时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/></li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
        </div>
        <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
            <table id="bondManagerList"></table>
        </div>
    </div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>